package com.love.labuladong;

/**
 * @Author : zh
 * @Description : 递归的方式遍历数组
 * @Date : 2024-07-12 14:24
 */
public class IteratorArrayByRecursion {


    public static void main(String[] args) {

        int[] arr = {1,3,5,2,3,2};

        recurseArray(arr,0);

    }


    public static void recurseArray(int[] arr,int i){
        if(i == arr.length){
            return;
        }

        recurseArray(arr,i+1);

        System.out.printf("%d ",arr[i]);

    }


}
